﻿function YgluTopAlert(msg, success)
{
	var $alert = $("#TopAlert");

	if ($alert.length)
	{
		$alert.html(msg);
		$alert.css("backgroundColor", success ? "#AAFFAA" : "#FFAAAA");

		var timer = window.setTimeout(function() { $alert.trigger("click"); }, 3200);

		$alert.animate({ height: $alert.css("line-height") || "50px" }, 200).click(function()
		{
			window.clearTimeout(timer);

			$alert.animate({ height: "0" }, 200);
		});
	}
};